#ifndef __G_ALIGN_H
#define __G_ALIGN_H

#include "config.h"

/* 小部件对齐方式 */
typedef enum _GAlign GAlign;
enum _GAlign
{
        G_ALIGN_LEFT   = 0x01,
        G_ALIGN_RIGHT  = 0x02,
        G_ALIGN_CENTER = 0x04,
        G_ALIGN_TOP    = 0x08,
        G_ALIGN_BOTTOM = 0x10,
};

/**
 * @brief 根据小部件绘制区域、小部件宽度和对齐方式计算小部件起始 X 坐标
 */
extern uint16_t
g_align_scale_sx(GAlign align, uint16_t sx, uint16_t ex, uint16_t width);

/**
 * @brief 根据小部件绘制区域、小部件宽度和对齐方式计算小部件起始 Y 坐标
 */
extern uint16_t
g_align_scale_sy(GAlign align, uint16_t sy, uint16_t ey, uint16_t height);

#endif
